<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');
?>
<p>
	<a href="index.php">&lt;&lt; Back to Instructors Portal</a><br />
</p>
<h1>Edit Instructor</h1>

<?php

$instructor_id = mysql_real_escape_string(strip_tags($_GET['id']));

//initialize variables used to connect to database
$db = "scheduler";
$user = "root";
$pass = "";

//counting variable
$i = 0;

//connect to database
mysql_connect("localhost", $user, $pass);
@mysql_select_db($db);

//select statement
$query="SELECT * FROM instructors WHERE id='$instructor_id'";
$result=mysql_query($query);

//close
mysql_close();

$instructor_fname=mysql_result($result,$i,"first_name");
$instructor_lname=mysql_result($result,$i,"last_name");

echo '<form action="edit_do.php" method="post">';

//start table
echo "<table border='0'>";
	
	//create table row
	echo "<tr>";
		echo "<td><b>First Name</b></td>";
		echo "<td>";
		echo "<input type='text' name='fname' value='$instructor_fname'>";
		echo "</td>";
	echo "</tr>";
	
	//create table row
	echo "<tr>";
		echo "<td><b>Last Name</b></td>";
		echo "<td>";
		echo "<input type='text' name='lname' value='$instructor_lname'>";
		echo "</td>";
	echo "</tr>";

//end table tag
echo "</table>";

echo "<input type='hidden' name='id' value='$instructor_id'>";
echo '<p><input type="submit"></p>';
echo '</form>';

	

?>



<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>